package com.mzy.datepackage.M2022.Apr.twFour;

import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/4/26 18:28
 * @Version 1.0
 */
public class SS {
    /**
     * 测试线程池
     */
    private final ScheduledThreadPoolExecutor executor;

    public SS(ScheduledThreadPoolExecutor executor) {
        this.executor = executor;
    }

    public void test(){
        final ScheduledFuture<?> ce = executor.scheduleAtFixedRate(() -> {
            System.out.println("测试一下");
        }, 0, 2, TimeUnit.SECONDS);
    }
}
